package l.l.w.CodingInterviews.jingdong;

import java.util.Scanner;

public class Two__ {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        long[] result = new long[2];
        for(int i = 0; i < t; ++i){
            long N = scanner.nextLong();
            long Y = 1;
            if((N & 1) == 1){
                System.out.println("No");
                continue;
            }
            while(N > 0){
                if((N & 1) == 0){
                    N >>= 1;
                    Y <<= 1;
                }else{
                    break;
                }
            }
            if(N == 0){
                System.out.println("No");
                continue;
            }else{
                System.out.println(N + " " + Y);
            }
        }
    }
}
